package com.guyaogg.gulimall.search.utils;

import com.alibaba.fastjson.JSON;
import com.guyaogg.common.to.es.SkuEsModel;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.common.xcontent.XContentType;

/**
 * @author 顾遥
 */
public class EsUtils {


    public static void sourceJson(SkuEsModel model, IndexRequest indexRequest) {
        String jsonString = JSON.toJSONString(model);
        indexRequest.source(jsonString, XContentType.JSON);
    }
}
